package com.zy.openchat.core.model.circle;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class InputBlogIdType implements Parcelable {
    @SerializedName(value = "@type")
    public String type;
    public long blog_id;
    public long reply_id;


    public InputBlogIdType(boolean isBlog, long id) {
        this.type = isBlog?"inputBlogIdBlog":"inputBlogIdReply";
        if(isBlog){
            this.blog_id = id;
        }else{
            this.reply_id = id;
        }
    }




    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.type);
        dest.writeLong(this.blog_id);
        dest.writeLong(this.reply_id);
    }

    public void readFromParcel(Parcel source) {
        this.type = source.readString();
        this.blog_id = source.readLong();
        this.reply_id = source.readLong();
    }

    public InputBlogIdType() {
    }

    protected InputBlogIdType(Parcel in) {
        this.type = in.readString();
        this.blog_id = in.readLong();
        this.reply_id = in.readLong();
    }

    public static final Creator<InputBlogIdType> CREATOR = new Creator<InputBlogIdType>() {
        @Override
        public InputBlogIdType createFromParcel(Parcel source) {
            return new InputBlogIdType(source);
        }

        @Override
        public InputBlogIdType[] newArray(int size) {
            return new InputBlogIdType[size];
        }
    };
}
